package com.woniuxy.lifeorder.api.feign.factory;

import com.woniuxy.lifeorder.api.feign.fallback.OrderServiceFallbackImpl;
import com.woniuxy.lifeorder.api.feign.OrderService;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class OrderServiceFallbackFactory implements FallbackFactory<OrderService> {
    @Override
    public OrderService create(Throwable throwable) {
        OrderServiceFallbackImpl impl=new OrderServiceFallbackImpl();
        impl.setCause(throwable);
        return impl;
    }
}
